package com.mask.juc.v1.c_001;

/**
 * 分析这个程序的输出
 * @author hx
 * @date 2021/10/11 10:24 上午
 */

public class T implements Runnable {

    private /*volatile*/ int count = 100;

    @Override
    public synchronized void run() {
        count--;
        System.out.println("线程名:"+Thread.currentThread().getName()+",count = "+count);
    }

    public static void main(String[] args) {
        T t = new T();
        for (int i = 0; i < 100; i++) {
            new Thread(t, "THREAD" + i).start();
        }
    }
}
